package com.tdam2014.grupo01.objects;

import org.json.JSONObject;

public class Photoset {

	private String id;
	private String primary;
	private String secret;
	private String server;
	private String title;
	private String description;
	private String userId;

	public Photoset(String userId) {
		this.userId = userId;
	}

	public Photoset(JSONObject objPhoto) {
		id = objPhoto.optString("id");
		server = objPhoto.optString("server");
		secret = objPhoto.optString("secret");
		primary = objPhoto.optString("primary");
		title = objPhoto.optJSONObject("title").optString("_content");
	}
	
	public Photoset() {

	}

	public String getServer() {
		return server;
	}

	public void setServer(String server) {
		this.server = server;
	}
	
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getPrimary() {
		return primary;
	}

	public void setPrimary(String primary) {
		this.primary = primary;
	}

	public String getSecret() {
		return secret;
	}

	public void setSecret(String secret) {
		this.secret = secret;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}
	
	@Override
	public boolean equals(Object object) {
		boolean sameSame = false;
		if (object != null && object instanceof Photoset) {
			sameSame = this.getId().equalsIgnoreCase(((Photoset) object).getId());
		}
		return sameSame;
	}

}
